package com.wgh.api.client.search;

import com.wgh.api.client.fallback.SearchClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * 搜索服务客户端接口
 */
@FeignClient(name = "shop-search", fallback = SearchClientFallback.class)
public interface SearchClient {

    /**
     * 搜索商品
     */
    @GetMapping("/search/product")
    Map<String, Object> searchProducts(@RequestParam Map<String, Object> searchParams);

    /**
     * 获取搜索建议
     */
    @GetMapping("/search/suggest")
    Map<String, Object> getSuggestions(@RequestParam("keyword") String keyword);

    /**
     * 获取热门搜索词
     */
    @GetMapping("/search/hot-words")
    Map<String, Object> getHotWords();

    /**
     * 搜索商品分类
     */
    @GetMapping("/search/category")
    Map<String, Object> searchCategories(@RequestParam Map<String, Object> params);

    /**
     * 搜索过滤
     */
    @GetMapping("/search/filter")
    Map<String, Object> getFilterOptions(@RequestParam Map<String, Object> params);
}